--扩散毒素
local kuosandusu = fk.CreateSkill {
    name = "mcdh_kuosandusu",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

kuosandusu:addEffect(fk.HpRecover,{
    can_trigger = function(self, event, target, player, data)
        local room = player.room
        local logic = room.logic
        if player:hasSkill(self) and target ~= player and not target:isKongcheng() and player:usedSkillTimes(self.name,Player.HistoryTurn) ==0 then
            return #logic:getActualDamageEvents(1, function(e)
                return e.data[1].to == target and e.data[1].from and  e.data[1].from ==player
            end, Player.HistoryRound) == 1
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local card = room:askForCardChosen(player, target, "h", self.name, "#mcdh_kuosandusu-prey:"..target.id)
        room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonPrey, self.name, nil, false, player.id)
    end
})

Fk:loadTranslationTable {
    ["mcdh_kuosandusu"] = "扩散毒素",
    [":mcdh_kuosandusu"] = "每回合限一次，本轮受到过你伤害的角色回复体力后，你可以获得其一张手牌。",
    ["#mcdh_kuosandusu-prey"] = "扩散毒素:获得 %src 一张手牌",
}

return kuosandusu